package demo;

public class CallBackTest {

	public static void main(String[] args) {
		doMyFream(new Fream1());
	}
	
	public static void doMyFream(MyFream mf){
		System.out.println("start");
		mf.print();
		System.out.println("end");
	}

}

abstract class MyFream{
	public abstract void print();
}

class Fream1 extends MyFream{

	@Override
	public void print() {
		System.out.println("Fream1");
	}
	
}

class Fream2 extends MyFream{

	@Override
	public void print() {
		System.out.println("Fream2");
	}
	
}
